Telegram Group Search
Cant decide between flask, django ninja or fastAPI for sideproject

As the title says, I cant decide what to use for rest api for mye summer project. I am uni student, so this project will only be very small scale project. I have made simpel rest apis in sll of them, but still cant decide which one to actuslly use for my project. Do anyone have any tips for which might be right one? A thing to consider for me answel is how easy it is to host.

/r/Python
https://redd.it/1dgbq1e
can django migration files cause database perfomance issue?

hi i changed my job and here and i see odd things happening

well there is a guy that for a django models creates a lot of migration files

so i searched and i did not find database perfomance issue article but can it actually cause it?

/r/django
https://redd.it/1dgf1po
Unsigned BigAutoField Django

The default BigAutoField in Django can fit up to 2^(63) − 1 = 9,223,372,036,854,775,807 (including 0 and negative numbers). One bit is reserved for sign but in Django BigAutoField is mostly used for id in models which are primary keys and primary keys are not negative so I want to utilize the BigAutoField capacity to fit numbers fully that is 2^(64) − 1 = 18,446,744,073,709,551,615.

For this, I need to make BigAutoField unsigned. Any solutions or suggestions to achieve this???



/r/django
https://redd.it/1dgj4sv
My honest opinions about Typer.

First of all, it's a very nice library to build great CLI, I have built like 10 CLIs till now just for my purposes like interaction with PYPI API, nodemon-like thing for Python (deleted the project for some reason, made when I was 12.5 years old) etc. but something makes me sad about this. Typer could've been a great tool if it was only built on top of argparse or optparse just like click (it is great but lacks good-quality documentation as said by a commenter on Reddit or Hacker News maybe).
See, Typer is itself written as a wrapper over click which is based on optparse which is calling functions over functions whatsoever! I know someone will come up with a joke called "Something is wrong with the speed, Nah, it's the language that is wrong". In general terms, it's wrapper + additional over a customizable wrapper over optparse. Which degrades the speed of execution time. I respect the project, that it simplifies the way of creating CLIs but it has a drawback, speed. I'm sceptical as to why they chose to click (for its internal dependency) over optparse or argparse for Typer development. If someone says, I don't

/r/Python
https://redd.it/1dglfxf
Better-OrderedMultiDict - a fast pure-pyton implementation of an ordered multi-valued dictionary.

# What my project does

It provides a fast pure-python implementation of an ordered, multi-valued dictionary.

# Target audience

Python developers that need this kind of specialized functionality.

This can be used in production. It has no dependencies. The code is unit-tested (almost fully, I'm working on it) It requires Python 3.12+

# Comparison

# Comparison to dict and OrderedDict

`dict` and `OederedDict` are already ordered, but they only allow one value per key. You could use a defaultdict of lists, but then you have these disadvantages:

* you can end up with empty lists within the dict if you aren't careful
* you lose the order of individual items within the dict:

​

items = [(1, '1'), (2, '2'), (2, '22'), (1, '11')]
normal_dict = defaultdict(list)
for key, value in items:
normal_dict [key].append(value)
om_dict = OrderedMultiDict(items)
print(list(normal_dict .items)) # prints [(1, ['1', '11']), (2, ['2', '22'])]
print(list(om\_dict.items)) # prints [(1, '1'), (2, '2'), (2, '22'), (1, '11')]

* iterating over all key/value pairs can be cumbersome as you need nested loops

# Comparison to [omdict](https://pypi.org/project/orderedmultidict/).

`OederedDict` provides a (in my opinion) nicer

/r/Python
https://redd.it/1dgmtbx
Sending SMS through GoIP GSM gateway using HTTP API

GoIP-1 is a simple network device that can be used in VoIP-GSM applications or as a local SMS gateway. For SMS there are services like Twilio but they can get expensive for regions far away from main telecom infrastructure (like islands) and this device can help.

You can find the device on Aliexpress and similar sites. The base model GoIP-1 has one SIM slot, while there are bigger ones for near industrial amount of SIM slots (and it gets very expensive).

The device has a web panel and simple HTTP GET endpoints for sending SMS so it can be scripted with Python or other programming language.

Check all the details in the article: https://rkblog.dev/posts/python/sending-sms-through-goip/

/r/Python
https://redd.it/1dgo671
Can't Fetch Data from Django REST framework onto NextJS while running on Docker Compose!

https://github.com/thekarananand/wikiNetes/tree/intergration

My NextJS frontend consists of A Server-side component and a client side component. While deployed on Docker-Compose, the Client-side component couldn't fetch data from Django App, meanwhile, the Server-side component works flawlessly. The Whole thing works like a charm when i run it, locally.

/r/django
https://redd.it/1dgo3wp
CSRF Timeout Issue

I have a django 5.0 site deployed to elastic beanstalk with a domain and https through cloud front.

When i make POST requests without the CSRF_TRUSTED_ORIGINS setting set, i get 403 errors which makes sense.

When i set the CSRF_TRUSTED_ORIGINS setting to the domain i'm on so that CSRF should work, i get 504 timeouts.

I have tried SSH'ing into the box and running the POST directly against the django site-- it does the timeout there too. So it's definitely not AWS. Something with django.

I've also tried downgrading to django 4-- didn't work either.

Everything works perfectly locally.

Any ideas?

/r/django
https://redd.it/1dgqc8j
I made a cool calendar app with PyQt6

Tempus is a calendar with horoscopes, reminders, etc made with PyQt6

# What my Project does?

Tempus is a desktop-based calendar management application built with PyQt6, allowing users to manage their todos, reminders, and special dates efficiently. It offers features like adding, editing, and deleting tasks and reminders, as well as marking dates as special. Tempus ensures users stay organized and never miss important events. Plus, it shows you how many days are remaining until a special day in the dashboard.

# Target Audience

Well, anyone who uses a desktop calendar app I guess?

# Comparison

I did some research and couldn't find good calendar apps made with PyQt6. If you guys knows any, please mention it below and I'm sorry in advance.

# GitHub

https://github.com/rohankishore/Tempus

/r/Python
https://redd.it/1dgpg4g
Advice on Writing End-to-End Tests in Web Development

I am writing a small-to-medium-sized Django project and using Django's testing framework along with Selenium to do UI E2E testing. Right now I am testing every aspect of the UI, but this has led to me creating hundreds of E2E tests, which take upwards of 30+ min. to fully complete. This is problematic because of the time needed to run the entire test suite and the fact that some tests appear to be working fine when ran individually, but fail when ran as part of the entire test suite, meaning debugging them requires running another 30+ min. test suite again.

I am new to web development. Could anyone tell me how to speed up the process (besides running in --headless mode), what is a good guide to determine how many E2E tests I should be writing for my application, and if hundreds of E2E tests are too many or just right?

Thanks in advance

/r/django
https://redd.it/1dg6pma
is django 1.11 too old to learn?

i have this course that my dad bought about full stack web dev. covers a lot of things (bootstrap, python, nodejs, and django) but the django version is 1.11. should i abandon this course due to the old version or will i still be able to learn and gain a master of django despite the older version. thanks!

/r/django
https://redd.it/1dgtwja
Fontawesome wont render, but the css files show up at http://127.0.0.1:5500/static/css/fontawesome/all.css

I am trying to avoid using CDNs and just have all the files in the directory structure.

However, I cant get the icons to display its just a empty box with no icon rendered. It will render when using the CDN.

<!DOCTYPE html>
<html lang="en" data-theme="{% block theme %}{% endblock theme %}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{{ urlfor('static', filename='css/output.css') }}">

<link rel="stylesheet" href="{{ url
for('static', filename='css/fontawesome/fontawesome.css') }}">
<link rel="stylesheet" href="{{ urlfor('static', filename='css/fontawesome/brands.css') }}">
<link rel="stylesheet" href="{{ url
for('static', filename='css/fontawesome/solid.css') }}">


<title>{% block title %}{% endblock title %} | Rate</title>
</head>
<body class="flex flex-col min-h-screen">
{% include 'partials/navbar/navbar.html' %}
<div class="flex-grow mt-10">


/r/flask
https://redd.it/1dgxn5v
Guidance or advice from fellow devs!

Last summer I read the trinity of William S. Vincent of Django and created around 15 projects on my own using Django, HTML and CSS aside from the ones he teach us in the books. I was also on a streak of improving my DSA skills solving Leetcode problems and took the Udacity & google free course. however that was between May and late September. I stopped around the beginning of October because I started to learn German (I'm a student who wants to go to Uni in Germany) and I reached a spot in German where I can continue doing other stuff alongside practicing it. During the last 8 Months I was always on LinkedIn looking out for the market needs and JS was always a requirement, that's why I decided to revise my already built knowledge in the following couple of months and start learning JS. I have two questions for those who are ahead of me:
1- Can you suggest me a project idea that includes almost everything in Django and the basics of HTML and CSS so I can practice alongside rereading the theoretical stuff ?
2- how do you recommend me to go

/r/djangolearning
https://redd.it/1dgrx8e
How do I learn django best practices/structuring projects

I would consider myself as a beginner-intermediate django developer but my projects often turn into a convoluted mess with business logic and validation slewn around in various places.

I think that the problem is that I don't know where each thing is supposed to go and so I make arbitrary defisions. Are there any resources I can follow or open source projects i can look at to get a better idea of how to structure my projects?



/r/django
https://redd.it/1dh2gb2
Just published the start of my website to Heroku. I feel awesome!

Its currently just a homepage but over the next few weeks I am going to be adding more and more to it so its fully functional. The color scheme is from DaisyUI so it doesnt match what the website is about.

The theme will be able to be changed via your profile once i get that all created. Currently just threw in the "dark" DaisyUI theme.


It 100% is NOT much or anything special but I made a post a few days ago about my struggles of learning programming specifically Python for the past few years (2019) so to have this up on the web is cool.

I used;

Flask
FontAwesome
TailwindCSS
DaisyUI
Heroku
CloudFlare Domain / SSL

RateMyMOS.com
Basically, its a website were past and present US service member will be able to go on and rate their occupation. This allows those looking to join or switch occupations to be able to see what others think.


It wont be as fancy as RateMyProfessors.com, and it 100% will not be about rating their chain of command.

/r/flask
https://redd.it/1dgzz3i
Sunday Daily Thread: What's everyone working on this week?

# Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

## How it Works:

1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.

## Guidelines:

Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

## Example Shares:

1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟

/r/Python
https://redd.it/1dgv2s3
Django HTMX SaaS starter kit

Is there anyone building a SaaS using Django + HTMX + Alpine? I'm building one for my clients.

Looking to opensource the boilerplate.

Anyone interested?

/r/django
https://redd.it/1dhcebu
building API for resume upload and perform other tasks

Hi, I am new to django, I am currently trying to do a project in my freetime and I was thinking of developing something basic like resume upload and anonymise the data to reduce bias in an application process for example, I am confused on the uploading of the CV and the process to anonymise the data through the API as I have read that this is done with JSON,

This is the what I had in mind:

Create (Upload a CV)

POST /cvs



Read (Return Anonymized Version of the CV)

GET /cvs/{cvId}/anonymized



Update (Perform Anonymization)

PUT /cvs/{cvId}/anonymize



Read (Show Anonymized Words)

GET /cvs/{cvId}/anonymized-words



Delete

DELETE /cvs/{cvId}

DELETE /cvs/{cvId}/anonymized

DELETE /cvs/{cvId}/anonymized-words



Create (Upload a CV)

API Endpoint: POST /cvs



Sample API Call:



POST /cvs

Sample JSON Request Body:



json

{

"candidateId": "12345",

"fileName": "resume./docx/pdf",

"fileContent": "base64EncodedFileContent"

}

Sample JSON Response:



json



{

"cvId": "67890",

"candidateId": "12345",

"fileName": "resume.pdf",

"uploadDate": "2024-06-10T10:00:00Z"

}

Read (Return Anonymized Version of the CV)

API Endpoint: GET /cvs/{cvId}/anonymized



Sample API Call:



GET /cvs/67890/anonymized

Sample JSON Response:



json



{

"cvId": "67890",

"anonymizedContent": "base64EncodedAnonymizedFileContent",

"anonymizationDate": "2024-06-10T12:00:00Z"

}

Update (Perform Anonymization)

API Endpoint: PUT /cvs/{cvId}/anonymize



Sample API Call:







PUT /cvs/67890/anonymize

Sample JSON Request Body:



json



{

"anonymizationSettings": {

"removeNames": true,

"removeContactInfo": true,

"removePersonalIdentifiers": true

}

}

Sample JSON Response:



json



{

"cvId": "67890",

"anonymized": true,

"anonymizationDate": "2024-06-10T12:00:00Z"

}

Read (Show Anonymized Words)

API Endpoint: GET /cvs/{cvId}/anonymized-words



Sample API Call:







GET /cvs/67890/anonymized-words

Sample

/r/djangolearning
https://redd.it/1dhcwaj
D Simple Questions Thread

Please post your questions here instead of creating a new thread. Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

Thanks to everyone for answering questions in the previous thread!

/r/MachineLearning
https://redd.it/1dh9f6b
Published my first Flask Project!

I’m excited to share my first live Flask project with you all: a very simple web tool to create favicons for websites. After learning Flask and working on several practice projects, this is the first one I've published live, and I would love to get your feedback.

https://www.voibl.com/favicon-generator

What does the web application do?

This web application allows users to easily create favicons for their websites based on Google's requirements. Here’s a quick rundown of its features:

1. Image Cropping: Users can upload an image and use a built-in cropping tool to select the desired portion of the image. The cropping tool maintains a square aspect ratio to ensure the favicon looks great.
2. Automatic Resizing: The application automatically resizes the cropped image to standard favicon sizes (48x48, 96x96, and 144x144 pixels), ensuring compatibility with various devices and browsers.
3. ICO File Generation: The cropped and resized images are saved as an ICO file, which is the standard format for favicons.
4. Unique URL Generation: Each generated favicon is stored in a unique folder, and the application provides a link tag that users can easily copy and paste into their website's HTML.

For those that want to see the source code: https://github.com/Note-To-Draft/voibl-favicon-generator



/r/flask
https://redd.it/1dhaxuz
2024/06/17 02:35:01
Back to Top
HTML Embed Code: